package xyz.zhno.mall.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.zhno.mall.common.mpg.entity.OmsOrderItem;
import xyz.zhno.mall.service.OmsOrderItemService;

import java.util.List;

/**
 * <p>
 * 订单中所包含的商品 前端控制器
 * </p>
 *
 * @author liushaoqi
 * @since 2021-01-04
 */
@RestController
@AllArgsConstructor
@RequestMapping("/omsOrderItem")
public class OmsOrderItemController {

    private final OmsOrderItemService omsOrderItemService;

    /**
     * 订单商品列表
     * @param id 订单id
     * @return 订单商品详情列表
     */

    @GetMapping("/getOmsOrderlist")
    public List<OmsOrderItem> getOmsOrder(Long id){
        return omsOrderItemService.list(new QueryWrapper<OmsOrderItem>().eq("order_id",id));
    }



}

